package com.hd.appcommon.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hd.appcommon.entity.StudentCourse;
import com.hd.appcommon.entity.vo.CourseTableExcelVo;
import com.hd.appcommon.entity.vo.CourseTableVo;
import com.hd.appcommon.mapper.StudentCourseMapper;
import com.hd.appcommon.service.StudentCourseService;
import com.hd.hdxgddcommon.page.MyPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.List;
import java.util.function.Function;

@Service
public class StudentCourseServiceImpl extends ServiceImpl<StudentCourseMapper, StudentCourse> implements StudentCourseService {
    @Autowired
    private StudentCourseMapper studentCourseMapper;

    @Override
    public boolean updateBatchByQueryWrapper(Collection<StudentCourse> entityList, Function<StudentCourse, QueryWrapper<StudentCourse>> queryWrapperFunction) {
        return false;
    }

    @Override
    public Integer isExist(String studentJobNumber, String courseSpecificCode,String schoolYear,String term) {
        return studentCourseMapper.isExist(studentJobNumber, courseSpecificCode, schoolYear, term);
    }

    @Override
    public IPage<CourseTableVo> getCourseTableVo(MyPage page,
                                                 String collegeName,
                                                 String studentName,
                                                 String jobNumber,
                                                 String schoolYear,
                                                 String term,
                                                 String courseName,
                                                 String courseType){
        return studentCourseMapper.getCourseTableVo(page,
                                                    collegeName,
                                                    studentName,
                                                    jobNumber,
                                                    schoolYear,
                                                    term,
                                                    courseName,
                                                    courseType);
    }

    @Override
    public List<CourseTableExcelVo> getCourseTableVo2(String collegeName, String studentName, String jobNumber, String schoolYear, String term, String courseName, String courseType) {
        return studentCourseMapper.getCourseTableVo2(
                collegeName,
                studentName,
                jobNumber,
                schoolYear,
                term,
                courseName,
                courseType);
    }

    @Override
    public void cleanMultipartData() {
        /*清除掉studentCourse表重复数据*/
        studentCourseMapper.cleanMultipartData();
    }

}
